package com.changpay.zywy.mvp.model


import com.changpay.zywy.base.BaseModel
import com.changpay.zywy.http.RetrofitHelper
import com.changpay.zywy.mvp.contract.HomeContract
import com.changpay.zywy.bean.*
import io.reactivex.Observable

/**
 * Created by chenxz on 2018/5/27.
 */
class HomeModel : BaseModel(), HomeContract.Model {
    override fun getUnreadInfo(token: String): Observable<HttpResult<UnReadInfoBean>> {
        return RetrofitHelper.service.get_unread_info(token)
    }

    override fun getSystemMsgList(): Observable<HttpResult<List<GongGaoBean>>> {
        return RetrofitHelper.service.get_system_msg_list()
    }

    override fun getUserInfo(token: String): Observable<HttpResult<UserInfo>> {
        return RetrofitHelper.service.getUserInfo(token)
    }

    override fun getInCome(token: String, version: String): Observable<HttpResult<TodayEarnings>> {
        return RetrofitHelper.service.getTodayEarnings(token,version)
    }

    override fun getBanner(): Observable<HttpResult<Banner>> {
        return RetrofitHelper.service.getBanners()
    }
}